/**
 * $Id: ConcretePrototype.java,v 1.0 2022/6/5 22:40 shidesheng Exp $
 * <p>
 * Copyright 2021 Sinosoft Co.,Ltd. All rights reserved.
 */
package sds.mode.prototype.shallow;

import java.util.List;

/**
 * @author shidesheng
 * @version $Id: ConcretePrototype.java,v 1.1 2022/6/5 22:40 shidesheng Exp $
 * Created on 2022/6/5 22:40
 */
public class ConcretePrototype implements Cloneable {

	private String name;
	private int age;
	private List<String> hobbies;

	public List<String> getHobbies() {
		return hobbies;
	}

	public void setHobbies(List<String> hobbies) {
		this.hobbies = hobbies;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	@Override
	public ConcretePrototype clone() {
		// 克隆对象
		ConcretePrototype clone = null;
		try {
			clone = (ConcretePrototype) super.clone();
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}
		return clone;
	}

	@Override
	public String toString() {
		return "ConcretePrototype{" +
				"name='" + name + '\'' +
				", age=" + age +
				", hobbies=" + hobbies +
				'}';
	}
}
